<template>
    <div>
        <el-dialog
            :title="!form.id ? '新增' : '修改'"
            :visible.sync="visible"
            :close-on-click-modal="false"
            @close="handleDialogClose">

            <div class="table_form_wrap">
                <el-form ref="form" :model="form" :rules="rules" @keyup.enter.native="handleSubmit()" label-width="120px">
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="酒店编号" prop="sn">
                                <el-input placeholder="酒店编号" v-model="form.sn" clearable></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="酒店编号" prop="aa">
                                <el-input placeholder="酒店编号" v-model="form.aa" clearable></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-form-item label="酒店编号" prop="bb">
                        <el-input placeholder="酒店编号" v-model="form.bb" clearable></el-input>
                    </el-form-item>
                    <el-form-item label="酒店编号" prop="cc">
                        <el-input placeholder="酒店编号" v-model="form.cc" clearable></el-input>
                    </el-form-item>

                </el-form>
            </div>


            <div slot="footer" class="dialog-footer">
                <el-button @click="visible = false">取 消</el-button>
                <el-button @click="handleSubmit('form')" type="primary" :loading="loading">提 交</el-button>
            </div>

        </el-dialog>
    </div>
</template>

<script>
export default {
    data() {
        return {
            visible: false,
            loading: false,

            form: {
                id: null,
                sn: null,
                aa: null,
                bb: null,
                cc: null,
            },
            rules: {

            }
        }
    },

    methods: {
        init(id) {
            this.form.id = id
            if(this.form.id) {

            } else {

            }
            this.visible = true
        },
        handleSubmit() {
            this.$emit('refreshDataList')
            this.loading = true

            this.loading = false
            this.visible = false
        },


        /**
         * 详细信息
         */
        getInfo(id) {
            // if (id) {
            //     return this.$http({
            //         url: '',
            //         method: 'GET'
            //     }).then(res => {
            //         if (this.ResultMessage(res, false)) {
            //             return res
            //         } else {
            //             this.$notify({ title: '错误', message: error, type: 'error' });
            //         }
            //     }).catch(error => {
            //         this.$notify({ title: '错误', message: error, type: 'error' });
            //     })
            // }
        },

        handleDialogClose() {
            this.$refs['form'].resetFields()
        }
    }
};
</script>

<style lang="scss" scoped></style>
